package so.wy.servicecenter.businessbed.dao.enums;

/**
 * 用户押金状态
 */
public enum StatusUserDepositEnum {
    /**
     * 创建
     */
    PAYD(1, "已收取"),
    /**
     * 处理中
     */
    NOTPAYD(2, "未收取");
    private Integer code;
    private String name;

    StatusUserDepositEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static StatusUserDepositEnum codeOf(Integer code) {
        if (code == null) {
            return null;
        }

        StatusUserDepositEnum[] values = values();
        for (StatusUserDepositEnum value : values) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }

    public static String codeOfDesc(Integer code) {
        StatusUserDepositEnum value = codeOf(code);

        return value == null ? "" : value.getName();
    }
}